#include <iostream>
#include <vector>
using namespace std;

int n, m, sum = 0;
vector<bool>vis(11);
void dfs(int x) {
    if (sum == m) {
        for (int i = 1; i <= n; i++) {
            if (vis[i]) cout << i << " ";
        }
        cout << endl;
        return;
    }
    if (sum > m || x > n) return;

    sum += x;
    vis[x] = true;
    dfs(x + 1);
    sum -= x;
    vis[x] = false;

    dfs(x + 1);
}

int main() {
    cin >> n >> m;

    dfs(1);
    return 0;
}